package org.edu.modules.skill.controller;

import java.io.*;
import java.net.URLDecoder;
import java.util.*;
import java.util.stream.Collectors;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.models.auth.In;
import org.apache.shiro.SecurityUtils;
import org.edu.common.api.vo.Result;
import org.edu.common.aspect.annotation.AutoLog;
import org.edu.common.constant.CommonConstant;
import org.edu.common.system.base.controller.BaseController;

import org.edu.common.system.query.QueryGenerator;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;

import org.edu.common.system.vo.LoginUser;
import org.edu.common.util.CommonUtils;
import org.edu.common.util.RestUtil;
import org.edu.common.util.TokenUtils;
import org.edu.common.util.oConvertUtils;
import org.edu.modules.skill.api.CommonApi;
import org.edu.modules.skill.entity.VeJwCjZhiye;
import org.edu.modules.skill.entity.VeJwCjZhiyeExcel;
import org.edu.modules.skill.entity.VeJwKsZhiye;
import org.edu.modules.skill.service.IVeJwCjZhiyeService;
import org.edu.modules.skill.service.IVeJwKsZhiyeService;
import org.edu.modules.util.CommonAipUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


 /**
 * @Description: 职业考试成绩
 * @Author: jeecg-boot
 * @Date:   2021-04-16
 * @Version: V1.0
 */
@Api(tags="职业考试成绩")
@RestController
@RequestMapping("/jingsaiProject/veJwCjZhiye")
@Slf4j
public class VeJwCjZhiyeController extends BaseController<VeJwCjZhiye, IVeJwCjZhiyeService> {
	@Autowired
	private IVeJwCjZhiyeService veJwCjZhiyeService;
	 @Autowired
	 private IVeJwKsZhiyeService veJwKsZhiyeService;
	@Autowired
	private CommonApi commonApi;

	/**
	 * 分页列表查询
	 *
	 * @param veJwCjZhiye
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-分页列表查询")
	@ApiOperation(value="职业考试成绩-分页列表查询", notes="职业考试成绩-分页列表查询")
	@GetMapping(value = "/list")
	public Result<?> queryPageList(VeJwCjZhiye veJwCjZhiye,
								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
								   HttpServletRequest req) {
		QueryWrapper<VeJwCjZhiye> queryWrapper = QueryGenerator.initQueryWrapper(veJwCjZhiye, req.getParameterMap());
		Page<VeJwCjZhiye> page = new Page<VeJwCjZhiye>(pageNo, pageSize);
		IPage<VeJwCjZhiye> pageList = veJwCjZhiyeService.page(page, queryWrapper);
		return Result.ok(pageList);
	}
	 /**
	  * 不分页查询
	  *
	  * @param veJwCjZhiye
	  * @param req
	  * @return
	  */
	 @AutoLog(value = "职业考试成绩-不分页查询")
	 @ApiOperation(value="职业考试成绩-不分页查询", notes="职业考试成绩-不分页查询")
	 @GetMapping(value = "/select")
	 public Result<?> queryList(VeJwCjZhiye veJwCjZhiye,
									HttpServletRequest req) {
		 QueryWrapper<VeJwCjZhiye> queryWrapper = QueryGenerator.initQueryWrapper(veJwCjZhiye, req.getParameterMap());
		 List<VeJwCjZhiye> list = veJwCjZhiyeService.list(queryWrapper);
		 return Result.ok(list);
	 }

	/**
	 *   添加
	 *
	 * @param veJwCjZhiye
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-添加")
	@ApiOperation(value="职业考试成绩-添加", notes="职业考试成绩-添加")
	@PostMapping(value = "/add")
	public Result<?> add(@RequestBody VeJwCjZhiye veJwCjZhiye) {
		veJwCjZhiyeService.save(veJwCjZhiye);
		return Result.ok("添加成功！");
	}

	/**
	 *  编辑
	 *
	 * @param veJwCjZhiye
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-编辑")
	@ApiOperation(value="职业考试成绩-编辑", notes="职业考试成绩-编辑")
	@PutMapping(value = "/edit")
	public Result<?> edit(@RequestBody VeJwCjZhiye veJwCjZhiye) {
		veJwCjZhiyeService.updateById(veJwCjZhiye);
		return Result.ok("编辑成功!");
	}

	/**
	 *   通过id删除
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-通过id删除")
	@ApiOperation(value="职业考试成绩-通过id删除", notes="职业考试成绩-通过id删除")
	@DeleteMapping(value = "/delete")
	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
		veJwCjZhiyeService.removeById(id);
		return Result.ok("删除成功!");
	}

	/**
	 *  批量删除
	 *
	 * @param ids
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-批量删除")
	@ApiOperation(value="职业考试成绩-批量删除", notes="职业考试成绩-批量删除")
	@DeleteMapping(value = "/deleteBatch")
	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
		this.veJwCjZhiyeService.removeByIds(Arrays.asList(ids.split(",")));
		return Result.ok("批量删除成功!");
	}

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "职业考试成绩-通过id查询")
	@ApiOperation(value="职业考试成绩-通过id查询", notes="职业考试成绩-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
		VeJwCjZhiye veJwCjZhiye = veJwCjZhiyeService.getById(id);
		if(veJwCjZhiye==null) {
			return Result.error("未找到对应数据");
		}
		return Result.ok(veJwCjZhiye);
	}


	 /**
	  * 通过班级id查找
	  *
	  * @param id
	  * @return
	  */
	 @AutoLog(value = "职业考试成绩-通过班级id查找")
	 @ApiOperation(value="职业考试成绩-通过班级id查找", notes="职业考试成绩-通过班级id查找")
	 @GetMapping(value = "/getXueshengCj")
	 public Result<?> getXueshengCj(@RequestParam(name="id",required=true) Integer id,@RequestParam(name="ksid",required=true) Integer ksid) {

	 	 JSONArray objectList = CommonAipUtils.getXueshengByBjid(id);
		 List<VeJwCjZhiye> target = new ArrayList<>();
		 if(objectList == null || objectList.size() == 0){
			 return Result.ok(target);
		 }

	 	 LambdaQueryWrapper<VeJwCjZhiye> queryWrapper=new LambdaQueryWrapper<>();
	 	 queryWrapper.eq(VeJwCjZhiye::getXzbid,id);
		 queryWrapper.eq(VeJwCjZhiye::getZyksid,ksid);
	 	 List<VeJwCjZhiye> veJwCjZhiye = veJwCjZhiyeService.list(queryWrapper);
	 	 Map<Integer,VeJwCjZhiye> cjZhiyeMap=new HashMap<>();
	 	 for(VeJwCjZhiye item:veJwCjZhiye){
			 cjZhiyeMap.put(item.getStuid(),item);
		 }
	 	 for(int i=0;i<objectList.size();i++){
			 JSONObject student = objectList.getJSONObject(i);
			if(cjZhiyeMap.containsKey(student.getInteger("id"))){
				target.add(cjZhiyeMap.get(student.getInteger("id")));
			}else {
				VeJwCjZhiye zhiye=new VeJwCjZhiye();
				zhiye.setZyksid(ksid);
				zhiye.setStuid(student.getInteger("id"));
				zhiye.setXh(student.getString("xh"));
				zhiye.setXm(student.getString("xm"));
				zhiye.setFalid(student.getInteger("fal_id"));
				zhiye.setXzbid(student.getInteger("bj_id"));
				zhiye.setGradeid(student.getInteger("grade_id"));
				zhiye.setSpecid(student.getInteger("spec_id"));
				zhiye.setXzid(student.getInteger("xz"));
				zhiye.setTerminalid(student.getInteger("terminal_id"));
				zhiye.setStatus(1);
				target.add(zhiye);
			}
		 }
		 return Result.ok(target);
	 }

	 /**
	  *  按班级批量导入
	  *
	  * @param dataList
	  * @return
	  */
	 @AutoLog(value = "职业考试成绩-按班级批量导入")
	 @ApiOperation(value="职业考试成绩-按班级批量导入", notes="职业考试成绩-按班级批量导入")
	 @PutMapping(value = "/batchAddOrEdit")
	 public Result<?> batchAddOrEdit(@RequestBody List<VeJwCjZhiye> dataList) {
	 	 dataList.forEach(item->{
	 	 	if(item.getId()==null){
				item.setCjlrrqsj(new Date());
			}
		 });
		 veJwCjZhiyeService.saveOrUpdateBatch(dataList);
		 return Result.ok("批量导入成功!");
	 }

	 /**
	  * 导出excel
	  *
	  * @param request
	  * @param veJwCjZhiye
	  */
	 @RequestMapping(value = "/exportXlsBanji")
	 public ModelAndView exportXlsBanji(HttpServletRequest request, VeJwCjZhiye veJwCjZhiye) {
		 QueryWrapper<VeJwCjZhiye> queryWrapper = QueryGenerator.initQueryWrapper(veJwCjZhiye, request.getParameterMap());
		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
		 List<VeJwCjZhiye> pageList = this.veJwCjZhiyeService.list(queryWrapper);
		 JSONArray objectList = CommonAipUtils.getXueshengByBjid(veJwCjZhiye.getXzbid());
		 List<VeJwCjZhiye> target = new ArrayList<>();
		 if(objectList != null && objectList.size() > 0){
			 Map<Integer,VeJwCjZhiye> cjZhiyeMap=new HashMap<>();
			 for(VeJwCjZhiye item:pageList){
				 cjZhiyeMap.put(item.getStuid(),item);
			 }
			 for(int i=0;i<objectList.size();i++){
				 JSONObject student = objectList.getJSONObject(i);
				 if(cjZhiyeMap.containsKey(student.getInteger("id"))){
					 target.add(cjZhiyeMap.get(student.getInteger("id")));
				 }else {
					 VeJwCjZhiye zhiye=new VeJwCjZhiye();
					 zhiye.setZyksid(veJwCjZhiye.getZyksid());
					 zhiye.setStuid(student.getInteger("id"));
					 zhiye.setXh(student.getString("xh"));
					 zhiye.setXm(student.getString("xm"));
					 zhiye.setFalid(student.getInteger("fal_id"));
					 zhiye.setXzbid(student.getInteger("bj_id"));
					 zhiye.setGradeid(student.getInteger("grade_id"));
					 zhiye.setSpecid(student.getInteger("spec_id"));
					 zhiye.setXzid(student.getInteger("xz"));
					 zhiye.setTerminalid(student.getInteger("terminal_id"));
					 zhiye.setStatus(1);
					 target.add(zhiye);
				 }
			 }
		 }

		 List<VeJwCjZhiyeExcel> array=new ArrayList<>();
//		map存key减少重复查询
		 Map<Integer,String> zybMap = CommonAipUtils.getZybIdNameMap();
		 Map<Integer,String> njMap = CommonAipUtils.getGradeIdNameMap();
		 Map<Integer,String> zyMap = new HashMap<>();
		 Map<Integer,String> banjiMap = new HashMap<>();

		 Map<Integer,String> zyrzmcMap = new HashMap<>();
		 for(VeJwCjZhiye item:target){
			 VeJwCjZhiyeExcel excelItem = new VeJwCjZhiyeExcel();
//			设置考试名称
			 if(item.getZyksid()!=null){
				 if(!zyrzmcMap.containsKey(item.getZyksid())){
					 VeJwKsZhiye zhiye =  veJwKsZhiyeService.getById(item.getZyksid());
					 zyrzmcMap.put(item.getZyksid(),zhiye == null ? null:zhiye.getName());
				 }
				 excelItem.setZyrzmc(zyrzmcMap.get(item.getZyksid()));
			 }
			 excelItem.setXh(item.getXh());
			 excelItem.setXm(item.getXm());
			 excelItem.setLlcj(item.getLlcj());
			 excelItem.setKscj(item.getKscj());
			 excelItem.setSccj(item.getSccj());
			 excelItem.setIspass(item.getIspass() == null || item.getIspass() == 0? "通过":"未通过");
			 excelItem.setZsh(item.getZsh());
			 excelItem.setZkzh(item.getZkzh());
//			专业部名称
			 if(item.getFalid()!=null && zybMap.containsKey(item.getFalid())){
				 excelItem.setFalidName(zybMap.get(item.getFalid()));
			 }
//			年级名称
			 if(item.getGradeid()!=null && njMap.containsKey(item.getGradeid())){
				 excelItem.setGradeidName(njMap.get(item.getGradeid()));
			 }
//			获取专业名称
			 if(item.getSpecid()!=null){
				 if(!zyMap.containsKey(item.getSpecid())){
					 zyMap.put(item.getSpecid(),CommonAipUtils.getZyById(item.getSpecid()));
				 }
				 excelItem.setSpecidName(zyMap.get(item.getSpecid()));
			 }
//			获取班级名称
			 if(item.getXzbid()!=null){
				 if(!banjiMap.containsKey(item.getXzbid())){
					 banjiMap.put(item.getXzbid(),CommonAipUtils.getBanjiById(item.getXzbid()));
				 }
				 excelItem.setXzbidName(banjiMap.get(item.getXzbid()));
			 }
			 array.add(excelItem);
		 }

		 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
		 mv.addObject("fileName", "职业认证成绩");
		 mv.addObject("entity", VeJwCjZhiyeExcel.class);
		 mv.addObject("params", new ExportParams("职业认证成绩报表", "导出人:" + sysUser.getRealname(), "职业认证成绩"));
		 mv.addObject("data", array);
		 return mv;
	 }


    /**
    * 导出excel
    *
    * @param request
    * @param veJwCjZhiye
    */
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, VeJwCjZhiye veJwCjZhiye) {

		QueryWrapper<VeJwCjZhiye> queryWrapper = QueryGenerator.initQueryWrapper(veJwCjZhiye, request.getParameterMap());
		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
		List<VeJwCjZhiye> pageList = this.veJwCjZhiyeService.list(queryWrapper);
		List<VeJwCjZhiye> exportList = null;
		String selections = request.getParameter("selections");
		if (oConvertUtils.isNotEmpty(selections)) {
			List<String> selectionList = Arrays.asList(selections.split(","));
			exportList = (List)pageList.stream().filter((item) -> {
				return selectionList.contains(item.getId());
			}).collect(Collectors.toList());
		} else {
			exportList = pageList;
		}
		List<VeJwCjZhiyeExcel> array=new ArrayList<>();
//		map存key减少重复查询
		Map<Integer,String> zybMap = CommonAipUtils.getZybIdNameMap();
		Map<Integer,String> njMap = CommonAipUtils.getGradeIdNameMap();
		Map<Integer,String> zyMap = new HashMap<>();
		Map<Integer,String> banjiMap = new HashMap<>();

		Map<Integer,String> zyrzmcMap = new HashMap<>();
		for(VeJwCjZhiye item:exportList){
			VeJwCjZhiyeExcel excelItem = new VeJwCjZhiyeExcel();
//			设置考试名称
			if(item.getZyksid()!=null){
				if(!zyrzmcMap.containsKey(item.getZyksid())){
					VeJwKsZhiye zhiye =  veJwKsZhiyeService.getById(item.getZyksid());
					zyrzmcMap.put(item.getZyksid(),zhiye == null ? null:zhiye.getName());
				}
				excelItem.setZyrzmc(zyrzmcMap.get(item.getZyksid()));
			}
			excelItem.setXh(item.getXh());
			excelItem.setXm(item.getXm());
			excelItem.setLlcj(item.getLlcj());
			excelItem.setKscj(item.getKscj());
			excelItem.setSccj(item.getSccj());
			excelItem.setIspass(item.getIspass() == null || item.getIspass() == 0? "通过":"未通过");
			excelItem.setZsh(item.getZsh());
			excelItem.setZkzh(item.getZkzh());
//			专业部名称
			if(item.getFalid()!=null && zybMap.containsKey(item.getFalid())){
				excelItem.setFalidName(zybMap.get(item.getFalid()));
			}
//			年级名称
			if(item.getGradeid()!=null && njMap.containsKey(item.getGradeid())){
				excelItem.setGradeidName(njMap.get(item.getGradeid()));
			}
//			获取专业名称
			if(item.getSpecid()!=null){
				if(!zyMap.containsKey(item.getSpecid())){
					zyMap.put(item.getSpecid(),CommonAipUtils.getZyById(item.getSpecid()));
				}
				excelItem.setSpecidName(zyMap.get(item.getSpecid()));
			}
//			获取班级名称
			if(item.getXzbid()!=null){
				if(!banjiMap.containsKey(item.getXzbid())){
					banjiMap.put(item.getXzbid(),CommonAipUtils.getBanjiById(item.getXzbid()));
				}
				excelItem.setXzbidName(banjiMap.get(item.getXzbid()));
			}
			array.add(excelItem);
		}


		ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
		mv.addObject("fileName", "职业认证成绩");
		mv.addObject("entity", VeJwCjZhiyeExcel.class);
		mv.addObject("params", new ExportParams("职业认证成绩报表", "导出人:" + sysUser.getRealname(), "职业认证成绩"));
		mv.addObject("data", array);
		return mv;
    }

    /**
      * 通过excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request;
		Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
		Iterator var6 = fileMap.entrySet().iterator();
		if (var6.hasNext()) {
			Map.Entry<String, MultipartFile> entity = (Map.Entry)var6.next();
			MultipartFile file = (MultipartFile)entity.getValue();
			ImportParams params = new ImportParams();
			params.setTitleRows(2);
			params.setHeadRows(1);
			params.setNeedSave(true);

			Result var11;
			try {
				//map存key减少重复查询
				Map<String,Integer> zybMap = CommonAipUtils.getZybNameIdMap();
				Map<Integer,String> njMap = CommonAipUtils.getGradeIdNameMap();
				Map<Integer,String> zyMap = new HashMap<>();
				Map<Integer,String> banjiMap = new HashMap<>();

				List<VeJwCjZhiyeExcel> list = ExcelImportUtil.importExcel(file.getInputStream(), VeJwCjZhiyeExcel.class, params);
				long start = System.currentTimeMillis();
				List<VeJwCjZhiye> targetList = new ArrayList<>();
				int success = 0;
				int error = 0;
				for(VeJwCjZhiyeExcel item:list){
					Integer ksid = getZyksIdByName(item.getZyrzmc());
					if(ksid == null){
						error ++ ;
						continue;
					}
					VeJwCjZhiye zhiye = getCjZhiyeByXhAndKs(item.getXh(),ksid);
//					不存在旧数据就新建
					if(zhiye==null){
						zhiye = new VeJwCjZhiye();


						JSONObject student = CommonAipUtils.getXueshengByXh(item.getXh(),item.getXm());
						if(student == null){
							error ++ ;
							continue;
						}
						zhiye.setStuid(student.getInteger("id"));
						zhiye.setFalid(student.getInteger("fal_id"));
						zhiye.setXzbid(student.getInteger("bj_id"));
						zhiye.setGradeid(student.getInteger("grade_id"));
						zhiye.setSpecid(student.getInteger("spec_id"));
						zhiye.setXzid(student.getInteger("xz"));
						zhiye.setTerminalid(student.getInteger("terminal_id"));
						zhiye.setZyksid(ksid);
						zhiye.setXm(item.getXm());
						zhiye.setXh(item.getXh());
//						if(StringUtils.isEmpty(item.getFalidName()) || zybMap.containsKey(item.getFalidName())){
//							error ++ ;
//							continue;
//						}
//						zhiye.setFalid(zybMap.get(item.getFalidName()));
						//已提交
						zhiye.setStatus(1);
						zhiye.setCjlrrqsj(new Date());
					}
					zhiye.setSccj(item.getSccj());
					zhiye.setKscj(item.getKscj());
					zhiye.setLlcj(item.getLlcj());
					zhiye.setZkzh(item.getZkzh());
					zhiye.setZsh(item.getZsh());
					targetList.add(zhiye);
					success++;
				}
				this.veJwCjZhiyeService.saveOrUpdateBatch(targetList);
				log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
				if(error == 0){
					return Result.ok("文件导入成功！数据行数：" + targetList.size());
				}else {
					return Result.ok("文件导入成功！成功" + success +"条，失败" +error + "条");
				}
			} catch (Exception var23) {
				log.error(var23.getMessage(), var23);
				var11 = Result.error("文件导入失败:" + var23.getMessage());
			} finally {
				try {
					file.getInputStream().close();
				} catch (IOException var22) {
					var22.printStackTrace();
				}

			}

			return var11;
		} else {
			return Result.error("文件导入失败！");
		}
    }


    private Integer getZyksIdByName(String name){
    	if(StringUtils.isEmpty(name)){
    		return null;
		}
		LambdaQueryWrapper<VeJwKsZhiye> queryWrapper=new LambdaQueryWrapper<>();
		queryWrapper.eq(VeJwKsZhiye::getName,name);
		queryWrapper.last(" limit 1 ");
		VeJwKsZhiye zhiye=veJwKsZhiyeService.getOne(queryWrapper);
		return zhiye!=null ? zhiye.getId():null;
	}

	 /**
	  * 验证对应学号的学生信息是否已经存在
	  * @param xh
	  * @return
	  */
	 private VeJwCjZhiye getCjZhiyeByXhAndKs(String xh, Integer ksid){
		 if(StringUtils.isEmpty(xh) || ksid == null){
			 return null;
		 }
		 LambdaQueryWrapper<VeJwCjZhiye> queryWrapper=new LambdaQueryWrapper<>();
		 queryWrapper.eq(VeJwCjZhiye::getZyksid,ksid);
		 queryWrapper.eq(VeJwCjZhiye::getXh,xh);
		 queryWrapper.last(" limit 1 ");
		 VeJwCjZhiye zhiye=veJwCjZhiyeService.getOne(queryWrapper);
		 return zhiye;
	 }
}
